<script setup lang="ts">
    import {useSlots,onMounted,useAttrs} from 'vue'
    const slots = useSlots() //  可以获取插槽内的Dom元素
    const atts = useAttrs();
    onMounted(()=>{
        console.log(slots.header && slots.header());
        console.log(slots,'这个')
        console.log(atts,'接受的属性');// defineProps传递的atts不接受
    })
</script>
<template>
    <h1>子组件应用Slot</h1>
    <slot name="header"></slot>
</template>